﻿using jbt.CodeCandy.AsTrEAM.Contracts;
using System.ServiceModel;
using System.Threading.Tasks;

namespace jbt.CodeCandy.AsTrEAM
{
    /// <summary>
    /// Allows an object to implement a stream manager service.
    /// </summary>
    [ServiceContract(Namespace = Settings.WCF.Namespage)]
    public interface IStreamManagerService
    {
        /// <summary>
        /// Downloads a stream.
        /// </summary>
        /// <param name="streamDownloadRequest">
        /// Specifies the stream to download.
        /// </param>
        /// <returns>
        /// The requested stream.
        /// </returns>
        [OperationContract]
        [FaultContract(typeof(StreamFault))]
        Task<StreamData> Download(StreamDownloadRequest streamDownloadRequest);

        /// <summary>
        /// Uploads a stream.
        /// </summary>
        /// <param name="streamData">
        /// Stream to upload.
        /// </param>
        /// <returns>
        /// The result of upload.
        /// </returns>
        [OperationContract]
        [FaultContract(typeof(StreamFault))]
        Task<NewStreamResult> Upload(StreamData streamData);
    }
}